<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .p1 {
            font-size: 20px;
        }

        .p2 {
            font-size: 40px;
        }

        .p3 {
            font-size: 60px;
        }
    </style>
</head>

<body>
    <button class="btn1">按钮20</button>
    <button class="btn2">按钮40</button>
    <button class="btn3">按钮60</button>
    <p>肖晋权sb</p>
    <script>
        var btn1 = document.querySelector('.btn1');
        var btn2 = document.querySelector('.btn2');
        var btn3 = document.querySelector('.btn3');


        function setSize(setFont) {
            document.body.style.fontSize = setFont + 'px';
        }
        btn1.onclick = function () {
            setSize(20);
        }
        btn2.onclick = function () {
            setSize(40);
        }
        btn3.onclick = function () {
            setSize(60);
        }



    </script>
</body>

</html>